#pragma once

#include "scope.h"
#include "ast.h"

class Sema // 语义分析
{
public:
    std::shared_ptr<ASTNode> SemaVariableDeclNode(llvm::StringRef name, CType* ty);
    std::shared_ptr<ASTNode> SemaVariableAccessNode(llvm::StringRef name);
    std::shared_ptr<ASTNode> SemaAssignExprNode(std::shared_ptr<ASTNode> left, std::shared_ptr<ASTNode> right);
    std::shared_ptr<ASTNode> SemaBinaryExprNode(std::shared_ptr<ASTNode> left, std::shared_ptr<ASTNode> right, OpCode op);
    std::shared_ptr<ASTNode> SemaNumberExprNode(int value, CType* ty);
private:
    Scope scope;
};